package com.hopes.bizz.poll.job;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;

/**
 * @author daijie
 * @version 1.0
 * @date 2023/5/29 9:20
 * @Description: xxl-job调用示例代码
 */
public class JobDemoService {
    @XxlJob("demoJobHandler")
    public void demoJobHandler() {
        // 获取参数
        String param = XxlJobHelper.getJobParam();
        // 获取分片参数
        int shardIndex = XxlJobHelper.getShardIndex();
        // 设置任务结果
        XxlJobHelper.handleSuccess();
    }
}
